﻿using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Traceability.Commont.Infrastructures.Interfaces
{
    public interface IDomainEvent
    {
        /// <summary>
        /// 获取注册得领域事件
        /// </summary>
        /// <returns></returns>
        IEnumerable<INotification> GetDoaminEvents();
        /// <summary>
        /// 注册领域事件
        /// </summary>
        /// <param name="notification"></param>
        void AddDomainEvent(INotification notification);
        /// <summary>
        /// 如果领域事件不存在，则注册事件
        /// </summary>
        /// <param name="notification"></param>
        void AddDomianEventIfAbsent(INotification notification);
        /// <summary>
        /// 清除注册实践领域
        /// </summary>
        void ClearDomainEvents();
    }
}
